package com.example.function;

import com.example.demo.entity.UserTest;

import java.util.function.Function;

public class FunctionTest3 {
    public static void main(String[] args) {
        System.out.println(testApply(new UserTest(), e -> e));

        System.out.println(testApply1(new UserTest(), e -> e.getName()));

    }

    static UserTest testApply(UserTest user, Function<UserTest, UserTest> function) {
        user.setName("ss");
        user.setAge(22);
        user.setGender(true);
        return function.apply(user);
    }


    static String testApply1(UserTest user, Function<UserTest, String> function) {
        user.setName("ss");
        user.setAge(22);
        user.setGender(true);
        return function.apply(user);
    }
}
